<html>
<head><meta charset="utf-8"><title>Liveness pass for asm! · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Liveness.20pass.20for.20asm!.html">Liveness pass for asm!</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="188059025"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Liveness%20pass%20for%20asm%21/near/188059025" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Liveness.20pass.20for.20asm!.html#188059025">(Feb 12 2020 at 22:20)</a>:</h4>
<p>I've been bashing my head for the last hour trying to understand how to fit the new asm! into the HIR liveness pass (librustc_passes/liveness.rs).</p>



<a name="188059088"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Liveness%20pass%20for%20asm%21/near/188059088" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Liveness.20pass.20for.20asm!.html#188059088">(Feb 12 2020 at 22:21)</a>:</h4>
<p>Basically asm! has 4 types of parameters: <code>in(expr)</code>, <code>out(place)</code>, <code>inout(place)</code>, <code>split_inout(expr =&gt; place)</code></p>



<a name="188059223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Liveness%20pass%20for%20asm%21/near/188059223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Liveness.20pass.20for.20asm!.html#188059223">(Feb 12 2020 at 22:23)</a>:</h4>
<p>The evaluation order is left to right, first for reads and place evaluation before the asm executes, the left to right again for writing the outputs to their destination place.</p>



<a name="188059277"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Liveness%20pass%20for%20asm%21/near/188059277" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Liveness.20pass.20for.20asm!.html#188059277">(Feb 12 2020 at 22:24)</a>:</h4>
<p>How does this map into the <code>write_place</code> and <code>propagate_through_expr</code> API of the liveness pass?</p>



<a name="188059282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Liveness%20pass%20for%20asm%21/near/188059282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Liveness.20pass.20for.20asm!.html#188059282">(Feb 12 2020 at 22:24)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="188059900"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Liveness%20pass%20for%20asm%21/near/188059900" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Liveness.20pass.20for.20asm!.html#188059900">(Feb 12 2020 at 22:32)</a>:</h4>
<p>Here's my current attempt, but I'm not sure how correct it is: <a href="https://gist.github.com/Amanieu/ebd5b82cd0b4e492b1d8ab8dc0649c37" target="_blank" title="https://gist.github.com/Amanieu/ebd5b82cd0b4e492b1d8ab8dc0649c37">https://gist.github.com/Amanieu/ebd5b82cd0b4e492b1d8ab8dc0649c37</a></p>



<a name="188060105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Liveness%20pass%20for%20asm%21/near/188060105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Liveness.20pass.20for.20asm!.html#188060105">(Feb 12 2020 at 22:34)</a>:</h4>
<p>Also I'm not exactly sure if I should be using <code>ACC_USE</code> here.</p>



<a name="188134588"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Liveness%20pass%20for%20asm%21/near/188134588" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Liveness.20pass.20for.20asm!.html#188134588">(Feb 13 2020 at 18:25)</a>:</h4>
<p>ping?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>